<template>
	<view class="home">
		<!-- 顶栏 -->
		<top-bar/>
		<!-- 轮播 -->
		<m-swiper :list="swiper_list"></m-swiper>
		<!-- 推荐 -->
		<recommend :list="recommend"/>
	</view>
</template>

<script>
	import TopBar from "./TopBar"
	import MSwiper from "./MSwiper"
	import Recommend from './Recommend'
	
	import {getSwiper} from "@/network/axios/swiper.js"
	import {getRecommend} from "@/network/axios/getRecommend.js"
	export default {
		components:{ TopBar, MSwiper, Recommend },
		data() {
			return {
				swiper_list: [],
				recommend: []
			}
		},
		onLoad() {
			//获取轮播图数据
			getSwiper().then((res) => {
				this.swiper_list = res.data.banners
			})
			
			//获取推荐歌单数据
			getRecommend().then((res) => {
				this.recommend = res.data.result
			})
		},
		methods: {
		}
	}
</script>

<style lang="less" scoped>
	.home {
		width: 100%;
	}
</style>
